#!/usr/bin/env python3
import random


class MastermindGame():
    def __init__(self):
        self._generated_string = ""
        used_digits = set()
        for i in range(4):
            digit = random.randrange(0, 10, 1)
            while digit in used_digits:
                digit = random.randrange(0, 10, 1)
            used_digits.add(digit)
            self._generated_string += str(digit)


    def guess(self, attempt_string):
        if len(attempt_string) != len(self._generated_string):
            return False
        bulls = 0
        cows = 0
        used_digits = set()
        for digit1, digit2 in zip(self._generated_string, attempt_string):   
            if digit1 == digit2:
                bulls += 1
            else:
                used_digits.add(digit1)
        for digit in attempt_string:
            if digit in used_digits:
                cows += 1
        if bulls == 4:
            return "Epic Win, bro!"
        return (bulls, cows)

if __name__ == "__main__":
    game = MastermindGame()
    while 1:
        s = input()
        print(game.guess(s))

